<template>
    <div>
        <div class="rec-title">热销推荐</div>
        <ul>
            <router-link tag="li" class="item border-bottom" v-for="item of list" :key="item.id"
            :to="'/detail/'+item.id">
                <div class="item-img-wrapper">
                    <img class="item-img" :src='item.imgUrl'/>
                </div>
                <div class="item-cont">
                    <p class="item-cont-title">{{item.title}}</p>
                    <p class="item-cont-detail">{{item.desc}}</p>
                    <button class="item-cont-btn">查看详情</button>
                </div>
            </router-link >
        </ul>
    </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props:{
      list:Array
  }
}
</script>

<style scoped>
    .rec-title{
        background:#eee;
        line-height:.8rem;
        text-indent:.2rem;
        margin-top:.06rem;
    }
    .item{
        display:flex;
        overflow:hidden;
        height:1.9rem;
    }
    .item .item-img{
        width:1.7rem;
        height:1.7rem;
        padding:.1rem;
    }
    .item .item-cont{
        flex:1;
        padding:.1rem;
        min-width:0
    }
    .item .item-cont .item-cont-title{
        line-height:.54rem;
        font-size:.32rem;

        overflow:hidden;
        white-space:nowrap;
        text-overflow:ellipsis;
    }
    .item .item-cont .item-cont-detail{
        line-height:.4rem;
        color:#ccc;

        overflow:hidden;
        white-space:nowrap;
        text-overflow:ellipsis;
    }
    .item .item-cont .item-cont-btn{
        background:#ff9300;
        padding:0 .2rem;
        line-height:.44rem;
        border-radius:.06rem;
        color:#fff;
        margin-top:.2rem;
    }
</style>
